using System;
using System.Collections;
using System.Data.SqlClient;

using LocalBoard.Domain;
using LocalBoard.Persistence;

using NUnit.Framework;

namespace LocalBoard.Domain
{
	/// <summary>
	/// Summary description for TestBoard.
	/// </summary>
	[TestFixture]
	public class TestBoard
	{
		private Board _unitUnderTest = null;

		[SetUp]
		public void setUp()
		{
			_unitUnderTest = new Board("test", Profile.CreateProfile("userId", "userName", "password", "email", "photo", "customInfo"), 0, 0, 1, BoardViewType.List);
		}

		[TearDown]
		public void tearDown()
		{
			_unitUnderTest = null;
		}

		[Test]
		public void testSetAddress()
		{
			Assert.AreEqual("", _unitUnderTest.Address);
			_unitUnderTest.Address = "test address";
			Assert.AreEqual("test address", _unitUnderTest.Address);
			Assert.AreEqual("<Board address=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetCity()
		{
			Assert.AreEqual("", _unitUnderTest.City);
			_unitUnderTest.City = "test address";
			Assert.AreEqual("test address", _unitUnderTest.City);
			Assert.AreEqual("<Board city=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetLatitude()
		{
			Assert.AreEqual("", _unitUnderTest.Latitude);
			_unitUnderTest.Latitude = "test address";
			Assert.AreEqual("test address", _unitUnderTest.Latitude);
			Assert.AreEqual("<Board latitude=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetLongitude()
		{
			Assert.AreEqual("", _unitUnderTest.Longitude);
			_unitUnderTest.Longitude = "test address";
			Assert.AreEqual("test address", _unitUnderTest.Longitude);
			Assert.AreEqual("<Board longitude=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetPlaceName()
		{
			Assert.AreEqual("", _unitUnderTest.PlaceName);
			_unitUnderTest.PlaceName = "test address";
			Assert.AreEqual("test address", _unitUnderTest.PlaceName);
			Assert.AreEqual("<Board placeName=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetPostalCode()
		{
			Assert.AreEqual("", _unitUnderTest.PostalCode);
			_unitUnderTest.PostalCode = "test address";
			Assert.AreEqual("test address", _unitUnderTest.PostalCode);
			Assert.AreEqual("<Board postalCode=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetRegion()
		{
			Assert.AreEqual("", _unitUnderTest.Region);
			_unitUnderTest.Region = "test address";
			Assert.AreEqual("test address", _unitUnderTest.Region);
			Assert.AreEqual("<Board region=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testGetState()
		{
			Assert.AreEqual("", _unitUnderTest.State);
			_unitUnderTest.State = "test address";
			Assert.AreEqual("test address", _unitUnderTest.State);
			Assert.AreEqual("<Board state=\"test address\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testGetAndSetAddress()
		{
			_unitUnderTest = new Board("test", Profile.CreateProfile("userId", "userName", "password", "email", "photo", "customInfo"), 0, 0, 1, BoardViewType.List, "<Board address=\"test address\" />");
			Assert.AreEqual("test address", _unitUnderTest.Address);
			_unitUnderTest.Address = "modfied address";
			Assert.AreEqual("<Board address=\"modfied address\" />", _unitUnderTest.DataXml.OuterXml);
		}
	}
}